/**
 * 给定数组，每次操作选一个元素减X，一共减K次
 * 问操作完最大值最小是多少
 * 很明显二分，对给定的value，问能否在K次操作将最大值降到value及其以下
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;

using Real = long double;
using llt = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

int N, K, X;
vector<llt> A;

bool check(llt value){
    int left = K;
    for(auto i : A){
        if(i > value){
            auto cha = i - value;
            auto c = cha / X;
            if(cha % X) c += 1;
            if(left < c) return false;
            left -= c;
        }
    }
    return true;
}

llt proc(){
    sort(A.begin(), A.end(), greater<llt>());
    llt left = A[N - 1] - (K + 0LL) * X, right = A[0], mid;
    do{
        mid = (left + right) / 2;
        if(check(mid)) right = mid - 1;
        else left = mid + 1;
    }while(left <= right);
    return left;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(nofkase--){
        cin >> N >> K >> X;
        A.assign(N, 0);
        for(auto & i : A) cin >> i;
        cout << proc() << endl;
    }
    return 0;
}